package com.einmeer.hfbank.mapper;

import com.einmeer.hfbank.entity.Deposit;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

/**
 * @author 芊嵛
 * @date 2024/1/13
 */
@Mapper
public interface DepositMapper {
    // 根据卡号查询所有信息多条
    List<Deposit> selectAllByCardNumber(@Param("cardNumber") Long cardNumber, @Param("depositType") Integer depositType);
    // 插入信息一条
    Integer insertOne(@Param("depositAmount") String depositAmount, @Param("depositType") int depositType, @Param("depositDate") Timestamp depositDate, @Param("depositTimes") int depositTimes, @Param("cardNumber") Long cardNumber);
    // 根据depositId修改金额、日期、是否更新次数
    Integer updateDeposit(@Param("depositId") Long depositId, @Param("depositAmount") String depositAmount, @Param("depositDate") Timestamp depositDate, @Param("depositTimes") Integer depositTimes);
    // 根据depositId修改存款类型
    Integer updateCurrent(Long depositId);
    // 根据 depositId查询一条记录
    Deposit selectOne(Long depositId);
}
